<template>
  <view class="search-box" :style="{backgroundColor: bgcolor}" @click="searchClickHandler" >
    <view class="search-item" :style="{borderRadius: radius+'rpx'}">
      <uni-icons type="search"></uni-icons>
      <text>搜索</text>
    </view>
  </view>
</template>

<script>
  export default {
    name:"my-search",
    data() {
      return {
        
      };
    },
    // 自定义样式数据容器
    props: {
      bgcolor: {
        type: String,
        default: '#c00000'
      },
      radius: {
        type: Number,
        default: 50
      }
    },
    methods: {
      searchClickHandler(){
        this.$emit('click', {xxx:'xxx'})
      }
    }
  }
</script>

<style lang="scss">

  .search-box {
    height: 50px;
    // background-color: #c00000;
    display: flex;
    justify-content: center;
    align-items: center;
    .search-item {
      display: flex;
      height: 72rpx;
      margin: 0 16rpx;
      width: 100%;
      justify-content: center;
      align-items: center;
      background-color: white;
      // border-radius: 50rpx;
      
      text {
        margin-left: 16rpx;
      }
    }
  }

</style>
